#define  _CRT_SECURE_NO_WARNINGS 1

#include <stdio.h>

int main()
{
    int n = 0;
    scanf("%d", &n);
    int gred[50] = { 0 };
    for (int i = 0; i < n; i++)
    {
        scanf("%d", gred + i);
    }
    for (int i = 0; i < n - 1; i++)
    {
        int j = 0;
        for (j = n - 1; j > i; j--)
        {
            if (gred[j] > gred[j - 1])
            {
                int tmp = gred[j];
                gred[j] = gred[j - 1];
                gred[j - 1] = tmp;
            }
        }
    }
    for (int i = 0; i < 5; i++)
    {
        printf("%d ", gred[i]);
    }
    printf("\n");

    return 0;
}